pp108 : Setting Access Control on Tables and Views of a Database

Setting Access Control on Tables and Views of a Database

This topic describes the procedure to set access control on the tables and views of a database.

Before you begin this task:

  • You must have created a Database Metadata configured to a WS-AppServer Service.
  • You must have created roles and published them to the organization.


While building an application, you may grant certain roles complete access or partial access to a database table or view. You may even decide to completely deny access to a particular database table or view.

TheSecurityfeature helps you set access control on a table or view of the database metadata. There are four levels at which you can set the control - Read, Insert, Update, and Delete. The extent to which a user (bearing that role) is able to work with a database depends upon the level at which access control is set. For instance, only Read access will let the user retrieve data from a table or view but will not allow storing data into the table or view. On the other hand, a Delete access will let the user retrieve data, modify data, and also delete data from the table or view.
The Web service operations generated on a particular table or view inherit the access control setting and behave accordingly at run time.

  1. Select one of the following starting points and select Tables or Views as instructed:
    • In Workspace Documents (Explorer), open <solution> > <project> > (Database Metadata), and do one of the following:
      • Expand Tables, right-click (Table Name) and select Define Runtime Security.
      • Expand Views, right-click (View Name) and select Define Runtime Security.
    • On the Database Metadata window, in the Children pane, do one of the following:
      • Place the mouse pointer on (Table Name), click and select Actions > Define Runtime Security .
      • Place the mouse pointer on (View Name) , click and select Actions > Define Runtime Security . The Security Descriptor window appears, displaying the name of the selected database table or view on its titlebar.
  2. In the Identities pane, click . The Select Role dialog box appears, displaying the roles that you created.
  3. Select the role for which you want to set access control. The selected role appears in the Identities pane.
  4. Select the role and in the ACL pane, select the Grant Permission checkbox against Read, or Update, or Insert, or Delete.
  5. Click .
    You have successfully set access control on the database table or view and associated it with a specific role.

    Tip: To set access control on all the database contents, you can define Runtime Security directly on the Database Metadata in the same way as it is done for an individual table/view.

After you complete this task:
To know how to view the access controls set for a particular role/user, see topic Viewing Access Permissions Granted for a Role.